package mylibrary.jmx;

import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;

//import com.sun.jdmk.comm.HtmlAdaptorServer;

public class HelloAgent {

	public static void main(String[] args) throws Exception {
		
		MBeanServer server = MBeanServerFactory.createMBeanServer();
		
		ObjectName helloName = new ObjectName("gaoshuai:name=HelloWorld");   //域名:name=MBean名称, 域名和MBean名称都可以任意取
		server.registerMBean(new Hello(), helloName);
		
		ObjectName adapterName = new ObjectName("HelloAgent:name=htmlAdapter, port=8082");
		//HtmlAdaptorServer adapter = new HtmlAdaptorServer();
		
		//server.registerMBean(adapter, adapterName);
		
		//adapter.start();   //http://localhost:8082
		
		
	}
}
